package com.example.twotwo_project;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

public class Frag01Activity extends Fragment {
		Context mContext;
		BodyFragment fragBody;
		
		public static Frag01Activity newInstance(Context mContext){
			Frag01Activity fragment = new Frag01Activity(mContext);
			return fragment;
		}
		
		public Frag01Activity(Context context) {
			mContext = context;
		}
		

		@Override
		public void onResume() {
			Button button1;
			button1 = (Button)getView().findViewById(R.id.button1);
			fragBody = BodyFragment.newInstance();
			button1.setOnClickListener(new OnClickListener() {
				
				@Override
				public void onClick(View v) {
					//FrameLayout fl = (FrameLayout)v.findViewById(R.id.FrameLayout1);
					Toast.makeText(getActivity(), "가슴", Toast.LENGTH_SHORT).show();
					Intent intent = new Intent(getActivity(), BodyFragment.class);
					startActivity(intent);
				}
			});
			
			
			super.onResume();
		}



		@Override
		public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
			View view = inflater.inflate(R.layout.activity_frag01, container, false);
			
	    	return view;
		}
}

